Skip to content

Fix issue with required check blocking merge#49

Merged
ejfine merged 8 commits intomainfrom
fix-ci
Jan 27, 2026
Merged

Fix issue with required check blocking merge#49
ejfine merged 8 commits intomainfrom
fix-ci

Conversation

@ejfine
Copy link
Contributor

@ejfine ejfine commented Jan 27, 2026

Why is this change necessary?

The previous approach didn't allow merges, because the manually created "processing" status still blocked the merge even after the attempted explicit "success" API call

How does this change address the issue?

change the name of the CI job so it doesn't match the needed status, and have the pull_request job explicitly set the required-check status to "success"

What side effects does this change have?

N/A

How is this change tested?

ejfine/aws-organization#30

pushing commits with an open PR. opening a PR after a successful commit run had finished. closing and reopening PR

Summary by CodeRabbit

  • Chores
    • Renamed and clarified CI job flow; broadened its conditions to run for pull requests.
    • Ensured lint runs earlier in the CI sequence.
    • Removed the duplicate-detection status step.
    • Updated final status updates to use the pull-request statuses endpoint, use a consistent run identifier for the target URL, and fixed an extraneous character in the Dependabot status.

✏️ Tip: You can customize this high-level summary in your review settings.

@ejfine ejfine self-assigned this Jan 27, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

Updated a GitHub Actions CI workflow: added lint as a prerequisite for pulumi-workflow, renamed a status job to workflow-summary and broadened its needs, removed a duplicate-status step, and changed status POSTs to use the pull request statuses URL with refined descriptions and target_url formatting.

Changes

Cohort / File(s) Summary
GitHub Actions CI workflow
template/.github/workflows/ci.yaml.jinja
Added lint to the dependency chain before pulumi-workflow; renamed required-check job to workflow-summary and adjusted its needs; removed the "Set status for duplicate detection" step and its conditional pending update; changed status POSTs to use ${{ github.event.pull_request._links.statuses.href }} when triggered by pull_request; refined descriptions and standardized target_url to use run_id.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as GitHub Actions Runner
    participant Lint as lint job
    participant CheckSkip as check-skip-duplicate job
    participant Pulumi as pulumi-workflow job
    participant GitHubAPI as GitHub Statuses API

    Runner->>Lint: run (new prerequisite)
    Runner->>CheckSkip: run
    CheckSkip-->>Runner: outputs.should-run
    alt event == pull_request and should-run == "true"
        Runner->>Pulumi: run (depends on lint)
        Pulumi->>GitHubAPI: POST to ${{ github.event.pull_request._links.statuses.href }} (context updated, target_url uses run_id)
        GitHubAPI-->>Pulumi: status accepted
    else
        Runner->>Pulumi: run without posting PR status (duplicate-detection path removed)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main change: fixing a required check that was blocking merge operations by ensuring the success API call targets the same commit as the processing status.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description covers the major required sections with clear explanations of the problem, solution, side effects, and testing approach.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@template/.github/workflows/ci.yaml.jinja`:
- Around line 112-120: The status update uses ${ github.event.after } which can
be undefined for pull_request events; replace that with the PR head SHA by using
${{ github.event.pull_request.head.sha }} in the gh api call so the POST to
"/repos/${{ github.repository }}/statuses/${SHA }}" always targets the PR
commit; update the step named "Mark the required-check from the job triggered by
the push as succeeded so the PR can be merged" (the gh api POST invocation that
currently references github.event.after) to use ${{
github.event.pull_request.head.sha }} instead.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@template/.github/workflows/ci.yaml.jinja`:
- Around line 113-114: The step name "Mark the required-check from the job
triggered by the push as succeeded so the PR can be merged" is inconsistent with
its if condition (github.event_name == 'pull_request') and the later
description; update the step name to reference "pull_request" (for example:
"Mark the required-check from the job triggered by the pull_request as succeeded
so the PR can be merged") so the name, condition, and description are
consistent; locate and edit the step name string in the workflow where the if
condition uses needs.check-skip-duplicate.outputs.should-run == 'true'.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where a required status check was blocking pull request merges. The solution renames the CI job to avoid automatic status creation and explicitly sets the required-check status via API calls only for pull request events.

Changes:

  • Renamed the required-check job to workflow-summary to decouple the job name from the status check name
  • Added lint as a dependency to pulumi-workflow to ensure linting runs earlier in the CI sequence
  • Removed the logic that set status to "pending" when duplicate detection skipped the workflow
  • Updated the status-setting step to run only for pull_request events and use the pull request statuses API endpoint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

-X POST -H "Accept: application/vnd.github.v3+json" \
"/repos/${{ github.repository }}/statuses/${{ github.sha }}" \
-f state=success -f context="required-check" -f description="✅ All required checks passed" \
"${{ github.event.pull_request.statuses_url }}" \
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of github.event.pull_request.statuses_url is inconsistent with line 119, which uses the explicit path format /repos/${{ github.repository }}/statuses/{sha}. While both approaches should work with gh api, using a consistent format throughout the file would improve maintainability. Consider using "/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" instead to match the pattern on line 119.

Suggested change
"${{ github.event.pull_request.statuses_url }}" \
"/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \

Copilot uses AI. Check for mistakes.
"/repos/${{ github.repository }}/statuses/${{ github.sha }}" \
-f state=success -f context="required-check" -f description="✅ All required checks passed" \
"${{ github.event.pull_request.statuses_url }}" \
-f state=success -f context="required-check" -f description="✅ All required checks passed in the job triggered by pull_request" \
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description text "✅ All required checks passed in the job triggered by pull_request" is unnecessarily verbose. The phrase "in the job triggered by pull_request" doesn't add meaningful information. Consider simplifying to "✅ All required checks passed" to match the clarity of the description on line 120.

Suggested change
-f state=success -f context="required-check" -f description="✅ All required checks passed in the job triggered by pull_request" \
-f state=success -f context="required-check" -f description="✅ All required checks passed" \

Copilot uses AI. Check for mistakes.
- name: Mark required-check as succeeded
if: needs.check-skip-duplicate.outputs.should-run == 'true'
- name: Mark the required-check as succeeded so the PR can be merged
if: ${{ github.event_name == 'pull_request' }}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition syntax if: ${{ github.event_name == 'pull_request' }} is inconsistent with the rest of the file, which uses the simpler if: syntax without wrapping the expression in ${{ }} (see lines 44, 59, 86, 113). For consistency, this should be written as if: github.event_name == 'pull_request'.

Copilot uses AI. Check for mistakes.
@ejfine ejfine merged commit 6d43d35 into main Jan 27, 2026
13 checks passed
@ejfine ejfine deleted the fix-ci branch January 27, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants